def printArray(array)
  array.each { |e|
    print e
    print ","
    }
  puts
end

def getFileName()
#  testFileName = "S:/Public/Jeff/test/testRuby.txt"
  testFileName = "E:/Mydoc/testio.txt"
end

module Inject
  def inject(n)
    each { | element |
      n = yield(n, element)
    }
    n
  end
  private :inject
  
  def sum(initial = 0)
    inject(initial) { | n, element | n + element}
  end
  
  def product1(initial = 1) # named "product()" doesn't work, suspect clash with sth
    inject(initial) { | n, element | n * element}
  end
end


